package wangjg.mda.gen;

import java.util.HashMap;
import java.util.Map;

import wangjg.mda.model.obj.ModelDataType;

public class PostgresDataType {

	public static final Map<String, String> dataTypes = new HashMap<String, String>();

	public static final String BYTE = "smallint";
	public static final String CHAR = "character";
	public static final String SHORT = "smallint";
	public static final String INTEGER = "integer";
	public static final String LONG = "bigint";
	public static final String FLOAT = "real";
	public static final String DOUBLE = "float8";//double precision
	public static final String STRING = "varchar";//character varying
	public static final String DATE = "timestamp without time zone";

	static {
		dataTypes.put(ModelDataType.BYTE, PostgresDataType.BYTE);
		dataTypes.put(ModelDataType.CHAR, PostgresDataType.CHAR);
		dataTypes.put(ModelDataType.SHORT, PostgresDataType.SHORT);
		dataTypes.put(ModelDataType.INTEGER, PostgresDataType.INTEGER);
		dataTypes.put(ModelDataType.LONG, PostgresDataType.LONG);
		dataTypes.put(ModelDataType.FLOAT, PostgresDataType.FLOAT);
		dataTypes.put(ModelDataType.DOUBLE, PostgresDataType.DOUBLE);
		dataTypes.put(ModelDataType.STRING, PostgresDataType.STRING);
		dataTypes.put(ModelDataType.DATE, PostgresDataType.DATE);
		dataTypes.put(ModelDataType.TIMESTAMP, PostgresDataType.DATE);
	}

}
